﻿
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/user/comment.css"></link>

<!--  -->
<div id="user" class="area clear">
	<div id="userleft">
		<div class="left-top">
			<img src="/uploads/<?php echo session('user.userpic'); ?>" width="150px" height="150px"></img>
		</div>
		<div class="sider-bar">
			<ul>
				<li><a href="<?php echo U("User/index"); ?>">基本资料</a></li>
				<li ><a href="<?php echo U("User/comment"); ?>">我的评论</a></li>
				<li class="activ"><a style="color:rgb(255,255,255);" href="<?php echo U("User/favorate"); ?>">我的收藏</a></li>
				<li><a href="<?php echo U("User/beans"); ?>">我的积分</a></li>
			</ul>
		</div>
	</div>
	<div id="userright">
		<div class="userinfo1">
		
		      		 	 <div class="star_goods" >
        <h3>
            <img src="__PUBLIC__/images/index/star.png" alt=""/>
            <span>我的收藏</span>
            <span class="vice"></span>
        </h3> 
        <ul>
        <?php  foreach($favorate as $k=>$v){ ?>
            <li class="star_goods_list">
                <ul>
                    <li class="goods_pic">
                      <img src="{$v['gimage']}" alt=""/>
                      <a href="javascript:void(0)"><img onclick="toDelete({$v['fid']})" src="__PUBLIC__/images/user/delete.png" alt="" class="NO_num"/></a>
                    </li>
                    <li class="goods_title"><p><span style="color:red"></span>{$v['title']}</p></li>
                    
                    <li class="pirce"><span>{$v['price']}</span></li>
                </ul>
            </li>
           <?php } ?>
        </ul>
    </div>
		</div>
		<div class="clear"></div>
		<div>{$page}</div>

		<div class="clear"></div>
	</div>
</div>

<script type="text/javascript">
		
		function toDelete(id){
			swal({   
					title: "确定删除？",  
					text: "",  
					type: "warning",   
					showCancelButton: true,   
					confirmButtonColor: "#DD6B55",   
					confirmButtonText: "确定",
					CancelButtonText:"取消"
					}, 
					function(){
						$.post("/User/delFavorate",
								  {
								    "id":id,
								  },
								  function(data){
								    if(data.s != 0){
								    	alert("参数错误");
								    }else{
								    	location.reload(true);
								    }
								  },"json");
					});
		}
   </script>


